<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title><!--不正常航班搜索--></title>
        <meta charset="utf-8">
        <meta name="viewport" content="target-densitydpi=device-dpi, width=device-width, initial-scale=1, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <link rel="stylesheet" href="css/project/ui-res-v3.css">
        <link rel="stylesheet" href="css/project/ui-input-v3.css">
        <link rel="stylesheet" href="css/project/ui-btn-v3.css">
        <link rel="stylesheet" href="css/project/ui-color-v3.css">
        <link rel="stylesheet" href="css/project/style.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/project/style.css">
        <link rel="stylesheet" href="css/zv_common.css">
        <script src="js/zy_control.js">
        </script>
        <script src="js/zy_click.js">
        </script>
        <script src="js/zy_json.js">
        </script>
		 <script src="js/base64.js">
        </script>
        <script src="js/main.js">
        </script>
        <script src="js/init.js">
        </script>
		<script src="js/talkingdata.js"></script>
        <style>
            .datecolor {
                color: #525252;
                padding-top: 0.4em;
            }
            
            .b-norarea {
                border-color: #ccc;
            }
            
            .passenger_infoborder {
                border-bottom: 1px solid #e5e5e5;
            }
            
            .passenger_infoborderb {
                border: 0px;
            }
            
            .passinfoba {
                background: #003f9e;
                font-weight: bold;
            }
            
            input[type =
            "radio"]:checked + div.passinfoba {
                background: #003f9e;
                color: #fff;
                border: 0px;
                overflow: hidden;
            }
            
            input[type = radio] + div.passinfoba {
                color: #003079;
                background: #fff;
                border-bottom: 0px;
                overflow: hidden;
            }
            
            .zvtakeoff {
                background: url(images/takeoff.png) no-repeat left;
            }
            
            .zvlanding {
                background: url(images/landing.png) no-repeat right
            }
            
            .zvtakeofff {
                color: #003079;
                font-size: 1em;
                font-weight: bold;
            }
            
            .datecolor1 {
                color: #525252;
            }
            
            .zvrefresh {
                margin-top: 1.2em;
                background: url(images/42.png) no-repeat;
                background-size: 50%
            }
            
            .ubr {
                border-right: solid #ccc 1px;
                border-bottom: 0px;
            }
            
            .drop_city {
                float: left;
            }
            
            .rising {
                float: left;
            }
            
            .drop {
                float: right;
            }
        </style>
    </head>
    <body class="um-vp" ontouchstart>
        <div id="page_1" class="ub ub-ver um-vp">
            <div class="ub ub-ver">
                <div class="fline  c-wh">
                    <div class='ub umar-t ub-ac'>
                        <div style="width:5.5em; text-align:justify; text-align-last:justify;-moz-text-align-last:justify; height:2em; line-height:2em">
                            起始日期
                        </div>
                        <div class="ub ub-f1 uba ub-ac b-bla b-norarea c-wh noboder">
                            <!--文本输入开始-->
                            <div class="ub-f1 ut-s uinn  tx-l t-gra ulh-sel" id="flightBeginDate" style="width:100%;" onclick="checked_day('flightBeginDate')">
                                请选择开始日期
                            </div>
                            <!--文本输入结束-->
                        </div>
                    </div>
                    <!--起始日期结束-->
                </div>
                <div class="fline  c-wh">
                    <div class='ub umar-t ub-ac'>
                        <div style="width:5.5em; text-align:justify; text-align-last:justify;-moz-text-align-last:justify; height:2em; line-height:2em">
                            结束日期
                        </div>
                        <div class="ub ub-f1 uba ub-ac b-bla b-norarea c-wh noboder">
                            <!--文本输入开始-->
                            <div class="ub-f1 ut-s uinn tx-l t-gra ulh-sel" id="flightEndDate" style="width:100%;" onclick="checked_day('flightEndDate')">
                                请选择结束日期
                            </div>
                            <!--文本输入结束-->
                        </div>
                    </div>
                    <!--结束日期结束-->
                </div>
                <div class="fline  c-wh">
                    <!--下拉列表开始-->
                    <div class="ub t-bla ub-ac umar-t">
                        <div style="width:5.5em; text-align:justify; text-align-last:justify;-moz-text-align-last:justify; height:2em; line-height:2em">
                            不正常情况
                        </div>
                        <div class="ub-f1 ub uba c-wh b-gra  sel  noboder">
                            <div class="ub-f1 ut-s uinn  tx-l t-gra ulh-sel">
                                请选择不正常原因
                            </div>
                            <div class="b-gra  umw2 ub ub-pc ub-ac">
                                <div class="ub-img umw1 umh1 res3">
                                </div>
                            </div>
                            <select name="deleteFlag" selectedindex="0" id="deleteFlag" onchange="zy_selectmenu(this.id)">
                                <option value="">请选择不正常原因</option>
                                <option value="CNL">取消</option>
                                <option value="OP">延误</option>
                                <option value="SHA">始发站机场变更</option>
                                <option value="RTB">返航</option>
                                <option value="ALT">备降</option>
                                <option value="CNLOP">取消和延误</option>
                                <option value="ALL">以上全部类型</option>
                            </select>
                        </div>
                    </div>
                    <!--下拉列表结束-->
                </div>
                <div class='ub umh4 uinn ubb b-norarea c-wh'>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="12%" align="left">
                                <div id="goleft" onclick="openAirPort('go');" style="display:none;">
                                    <img src="images/takeoff.png">
                                </div>
                                <div id="rising" onclick="cancel('rising');" style="display:block;">
                                    <img src="images/del.png">
                                </div>
                            </td>
                            <td width="30%" align="left">
                                <div onclick="openAirPort('go');">
                                    <div class="umh3 ulev0">
                                        出发城市
                                    </div>
                                    <div id="dept_code" style="display:none;"></div>
                                    <div class="zvtakeofff" id="dept">选择城市</div>
                                </div>
                            </td>
                            <td width="16%" align="center">
                                <div onclick="adjustable()">
                                    <img src="images/42.png">
                                </div>
                            </td>
                            <td width="30%" align="right">
                                <div onclick="openAirPort('come');">
                                    <div class="umh3 ulev0">
                                        <span>到达城市</span>
                                    </div>
                                    <div id="arr_code" style="display:none;">PEK</div>
                                    <div class=" umh3 zvtakeofff" id="arr">北京首都</div>
                                </div>
                            </td>
                            <td width="12%" align="right">
                                <div id="goright" onclick="openAirPort('come');" style="display:none;">
                                    <img src="images/landing.png">
                                </div>
                                <div id="drop" onclick="cancel('drop');" style="display:block;">
                                    <img src="images/del.png">
                                </div>
                            </td>
                        </tr>
                    </table>
                </div><!--提交按钮-->
                <div ontouchstart="zy_touch('zv-btn-act')" class="zvbtn  c-blu1  t-wh tx-c uc-a1 zvbtnpadding" style="z-index:1000" onclick="LoadDataS()">
                    确 定
                </div>
            </div>
            <div class="logobg" style="z-index:-1">
                <img src="images/logobg.png" width="80%">
            </div>
        </div>
    </body>
    <script>
        zy_init();
		
	$$("flightBeginDate").innerHTML = getNowFormatDate();
	var backup_flightBeginDate_hb= localStorage.getItem("backup_flightBeginDate_hb")
	if(backup_flightBeginDate_hb!='null' && backup_flightBeginDate_hb!=null && backup_flightBeginDate_hb!='' &&backup_flightBeginDate_hb!=undefined)
	{
	$$("flightBeginDate").innerHTML =backup_flightBeginDate_hb;	
	}
	$$("flightEndDate").innerHTML = getNowFormatDate();
	var backup_flightEndDate_hb= localStorage.getItem("backup_flightEndDate_hb")
	if(backup_flightEndDate_hb!='null' && backup_flightEndDate_hb!=null && backup_flightEndDate_hb!='' &&backup_flightEndDate_hb!=undefined)
	{
	$$("flightEndDate").innerHTML =backup_flightEndDate_hb;	
	}
		
        
        var bodyH = document.body.clientHeight;
        document.getElementById("page_1").style.height = (bodyH - 10) + "px"
        function openAirPort(type){
            localStorage.setItem("zvAirPortType", type);
            localStorage.setItem("html", "unnormal_flight");
            openNewWin('airport', 'airport.html');
        }
        
        function setAirPort(name, code){
            var zvAirPortType = localStorage.getItem("zvAirPortType");
            if (zvAirPortType == 'go') {
                $$("dept").innerHTML = name;
                $$("dept_code").innerHTML = code;
                if (code != '') {
                    document.getElementById("rising").style.display = 'block'
                    document.getElementById("goleft").style.display = 'none'
                    
                }
            }
            if (zvAirPortType == 'come') {
                $$("arr").innerHTML = name;
                $$("arr_code").innerHTML = code;
                if (code != '') {
                    document.getElementById("drop").style.display = 'block'
                    document.getElementById("goright").style.display = 'none'
                }
            }
        }
        function cancel(state){
            if (state == 'rising') {
                $$("dept").innerHTML = '选择城市';
                $$("dept_code").innerHTML = '';
                document.getElementById("rising").style.display = 'none'
                document.getElementById("goleft").style.display = 'block'
            }
            if (state == 'drop') {
                $$("arr").innerHTML = '选择城市';
                $$("arr_code").innerHTML = '';
                document.getElementById("drop").style.display = 'none'
                document.getElementById("goright").style.display = 'block'
            }
        }
        
        function adjustable(){
            var arr_code = $$("arr_code").innerHTML;
            var arr = $$("arr").innerHTML;
            var dept_code = $$("dept_code").innerHTML;
            var dept = $$("dept").innerHTML;
            $$("dept_code").innerHTML = arr_code;
            $$("dept").innerHTML = arr;
            $$("arr_code").innerHTML = dept_code;
            $$("arr").innerHTML = dept;
            if (arr_code != '') {
                document.getElementById("rising").style.display = 'block'
            }
            else {
                document.getElementById("rising").style.display = 'none'
            }
            if (dept_code != '') {
                document.getElementById("drop").style.display = 'block'
            }
            else {
                document.getElementById("drop").style.display = 'none'
            }
        }
        function passenger_search(carrier){
            $$("carrier").value = carrier;
        }
        
        window.uexOnload = function(type){
			setLocalLocation(setDefauleIATACodeCallback);
            if (!type) {
                uexWindow.setBounce("0");
				IC.talkingDataCount("不正常航班","0013");
            }
        }
        
        function LoadDataS(){
            //checkUserRole(ZV_EMPLOYEE_NUMBER,'BTN_0_8',function(){LoadDataS2();});
			IC.talkingDataCount("不正常航班","0013");
            LoadDataS2()
        }
        function LoadDataS2(){
            var deptPort = $$("dept_code").innerHTML; /*起飞机场*/
            var arrivPort = $$("arr_code").innerHTML;/*降落机场*/
            var flightBeginDate = $$("flightBeginDate").innerHTML;/*开始时间*/
            var flightEndDate = $$("flightEndDate").innerHTML;/*结束时间*/
			localStorage.setItem("backup_flightBeginDate_hb",flightBeginDate);
			localStorage.setItem("backup_flightEndDate_hb",flightEndDate);
            var deleteFlag = $$("deleteFlag").value;/*不正常原因*/
            var actioncode = '10001';/*用户名*/
            var password = 'ceair_yddf';/*密码*/
			var time_Begin = flightBeginDate.split("-");
			var time_End = flightEndDate.split("-");
			var time_type=0
			var time_Begin_d=parseInt(time_Begin[2])
			var time_End_d=parseInt(time_End[2])
			var time_Begin_a=parseInt(time_Begin[1])
			var time_End_a=parseInt(time_End[1])
			var time_Begin_sdate=zv_transdate(flightBeginDate)
			var time_End_sdate=zv_transdate(flightEndDate)
			var time_sdate=time_End_sdate-time_Begin_sdate
			if(time_sdate>2678400)
			{
				time_type=1
			}
			else
			{
				if(time_Begin_d>time_End_d&&time_Begin_a==time_End_a)
				{
					time_type=1
				}
			}
			
	            if (flightBeginDate == '' || flightBeginDate == '请选择开始日期') {
	                $alert('请选择开始日期');
	                return false;
	            }
	            else if (flightEndDate == '' || flightEndDate == '请选择结束日期') {
	                    $alert('请选择结束日期');
	                    return false;
	            }
	           else  if (flightBeginDate > flightEndDate) {
	                   $alert('开始日期不能大于结束日期');
	                   return false;
	          }
			  else if(time_type==1)
			  {
			  		  $alert('起始日期不能大于一个月');
	                   return false;
			  }
	          else  if (deleteFlag == '') {
	                  $alert('请选择不正常原因');
	                  return false;
	         }
	        else {
				   uexEMM.setEvent("1","{'不正常航班':'不正常航班搜索'}");
				   IC.talkingDataCount("不正常航班","0013");
	               passenger_inform(deptPort, arrivPort, flightBeginDate, flightEndDate, deleteFlag, actioncode, password)
	         }
        }
        function passenger_inform(deptPort, arrivPort, flightBeginDate, flightEndDate, deleteFlag, actioncode, password){
			Loading(0);
			localStorage.setItem("zvData",'')
			localStorage.setItem("monitoring_judge","")
            localStorage.setItem("flightBeginDate", flightBeginDate);
            localStorage.setItem("flightEndDate", flightEndDate);
            var wsdl = unnormal_flight_url
            var nameSpace = unnormal_flight_nameSpace
            var paras = "actioncode|password|flightCarrier|flightNo|flightBeginDate|flightEndDate|deleteFlag|delayMin|deptPort|arrivPort";
            var values = actioncode + '|' + password + '|||' + flightBeginDate + '|' + flightEndDate + '|' + deleteFlag + '||' + deptPort + '|' + arrivPort + '|';
            var method = unnormal_flight_function
            monitoringJosn(wsdl, nameSpace, paras, values, method, "unnormal_flightresult", "unnormal_flightresult.html", "no");
			setTimeout('unnormal_stop()',12000)//两分钟后执行
        }
		function unnormal_stop()
		{
			var zvData=localStorage.getItem("zvData")
			if(zvData==''||zvData=='undefined'||zvData==undefined||zvData==null)
			{
					localStorage.setItem("monitoring_judge","1")//超时
					$alert("查询超时")
					Loading(-1);
			}
		}
    </script>
</html>
